<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <css href="../Public/css/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>{$Think.lang.home_title}</title>
<js href="../Public/js/jquery-1.7.2.min.js"/>
<script type="text/javascript">
/* 按下F5时仅刷新iframe页面 */
function inactiveF5(e) {
	return ;
	e=window.event||e;
	var key = e.keyCode;
	if (key == 116){
		parent.MainIframe.location.reload();
		if(document.all) {
			e.keyCode = 0;
			e.returnValue = false;
		}else {
			e.cancelBubble = true;
			e.preventDefault();
		}
	}
}

function nof5() {
    return ;
	if(window.frames&&window.frames[0]) {
		window.frames[0].focus();
		for (var i_tem = 0; i_tem < window.frames.length; i_tem++) {
			if (document.all) {
				window.frames[i_tem].document.onkeydown = new Function("var e=window.frames[" + i_tem + "].event; if(e.keyCode==116){parent.MainIframe.location.reload();e.keyCode = 0;e.returnValue = false;};");
			}else {
				window.frames[i_tem].onkeypress = new Function("e", "if(e.keyCode==116){parent.MainIframe.location.reload();e.cancelBubble = true;e.preventDefault();}");
			}
		} //END for()
	} //END if()
}

function refresh() {
	parent.MainIframe.location.reload();
}

document.onkeydown=inactiveF5;
</script>
</head>

<body scroll="no" style="margin:0; padding:0;" onload="nof5()">

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="3">
		<div class="header"><!-- 头部 begin -->
		    <div class="logo"><a href="" >&nbsp;</a></div>
                    <div id="load-div" style="padding: 30px 20px 20px 0px; text-align:left;display: none; color: #FF9900;width:40%;float:right;"><img src="__PUBLIC__/images/ajaxloading.gif" width="16" height="16" alt="正在处理您的请求..." style="vertical-align: middle" /> {$Think.lang.process_request}</div>
		    <div class="nav_sub">
		    	您好,[ {$Think.session.user_name} ]&nbsp; | <a href="{:U('Index/index')}">返回前台</a> | <a href="javascript:void(0);" onclick="refresh();">清空缓存</a> | <a href="javascript:void(0);" onclick="refresh();">刷新</a> | <a href="{:U('Admin/Public/logout')}">退出</a><br/>
		    	<div id="TopTime">
                             
                            
                        </div>
		    </div>
		    <div class="main_nav">
		    	<volist name="menus" id="vo">
		    	<a id="channel_{$vo.id}"  href="javascript:void(0)" onclick="switchChannel('{$vo.id}');" hidefocus="true" style="outline:none;">{$vo.mc}</a>
		    	</volist>
                       
		    </div>
		</div>
		<div class="header_line"><span>&nbsp;</span></div>
		<!-- 头部 end -->
	</td>
  </tr>
  <tr>
  	<td width="200px" height="100%" valign="top" id="FrameTitle" background="../Public/images/left_bg.gif">
  		<div class="LeftMenu">
  			<volist name="menus" id="vo">
  				<!-- 第一级菜单，即大频道 -->
  				<ul class="MenuList" id="root_{$vo.id}"  style="display:none;">
  				<!-- 第二级菜单 -->
  					<li class="treemenu">
  						<a id="root_{$vo.id}" class="actuator" href="javascript:void(0)" onclick="switch_root_menu('{$vo.id}');" hidefocus="true" style="outline:none;">{$vo.mc}</a>
  					</li>
					<present name="vo['menus']">
  					<ul id="tree_{$vo.id}" class="submenu">
						<!-- 第三级菜单 -->
						<volist name="vo['menus']" id="menu">
						<li><a id="menu_{$menu.id}" href="javascript:void(0)" onClick="switch_sub_menu('{$menu.id}', '__APP__/{$menu.url}');" class="submenuA" hidefocus="true" style="outline:none;">{$menu.mc}</a></li>
						</volist>
  					</ul>
  					</present>
  				</ul>
  			</volist>

				</div>
	</td>
    <td>
   	  <iframe onload="nof5()" id="MainIframe" name="MainIframe" scrolling="yes" src="__URL__/main" width="100%" height="100%" frameborder="0" noresize> </iframe>
	</td>
  </tr>
</table>

</body>
<script type="text/javascript">
	var current_channel   = null;
	var current_menu_root = null;
	var current_menu_sub  = null;
	var viewed_channel	  = new Array();

	$(document).ready(function(){
		switchChannel('1');
	});

	//切换频道（即头部的tab）
	function switchChannel(channel) {
		if(current_channel == channel) return false;

		$('#channel_'+current_channel).removeClass('on');
		$('#channel_'+channel).addClass('on');

		$('#root_'+current_channel).css('display', 'none');
		$('#root_'+channel).css('display', 'block');

		var tmp_menulist = $('#root_'+channel).find('a');
		tmp_menulist.each(function(i, n) {
			// 防止重复点击ROOT菜单
			if( i == 0 && $.inArray($(n).attr('id'), viewed_channel) == -1 ) {
				$(n).click();
				viewed_channel.push($(n).attr('id'));
			}
			if ( i == 1 ) {
				$(n).click();
			}
		});

		current_channel = channel;
	}

	function switch_root_menu(root) {
		root = $('#tree_'+root);
		if (root.css('display') == 'block') {
			root.css('display', 'none');
			root.parent().css('backgroundImage', 'url(../Public/images/ArrOn.png)');
		}else {
			root.css('display', 'block');
			root.parent().css('backgroundImage', 'url(../Public/images/ArrOff.png)');
		}
	}

	function switch_sub_menu(sub, url) {
		if(current_menu_sub) {
			$('#menu_'+current_menu_sub).attr('class', 'submenuA');
		}
		$('#menu_'+sub).attr('class', 'submenuB');
		current_menu_sub = sub;

		parent.MainIframe.location = url;
	}

	/*
	function resetEscAndF5(e) {
		e = e ? e : window.event;
		actualCode = e.keyCode ? e.keyCode : e.charCode;
		if(actualCode == 116 && parent.MainIframe) {
			parent.MainIframe.location.reload();
			if(document.all) {
				e.keyCode = 0;
				e.returnValue = false;
			} else {
				e.cancelBubble = true;
				e.preventDefault();
			}
		}
	}

	function _attachEvent(obj, evt, func, eventobj) {
		eventobj = !eventobj ? obj : eventobj;
		if(obj.addEventListener) {
			obj.addEventListener(evt, func, false);
		} else if(eventobj.attachEvent) {
			obj.attachEvent('on' + evt, func);
		}
	}

	_attachEvent(document.documentElement, 'keydown', resetEscAndF5);
	_attachEvent(window, 'keydown', resetEscAndF5, parent.frames[0]);
	*/
</script>
</html>